package com.neusoft.controller;

import com.neusoft.feign.EmpFeignClient;
import com.neusoft.po.Emp;
import com.neusoft.po.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/emp")
public class EmpController {
    @Qualifier("com.neusoft.feign.EmpFeignClient")
    @Autowired
    private EmpFeignClient efc;

    @GetMapping("/getEmpByNo/{empno}")
    ResponseBean<Emp> getEmpByNo(@PathVariable("empno") Integer empno){
        return efc.getEmpByNo(empno);
    }
}
